package com.fancy.learncenter.activity;

import android.content.Intent;
import android.os.Bundle;
import android.widget.LinearLayout;

import com.fancy.learncenter.activity.base.BaseActivity;
import com.fancy.learncenter.bean.BaseDataBean;
import com.fancy.learncenter.bean.Student;
import com.fancy.learncenter.net.HttpMehtod;
import com.fancy.learncenter.net.IdeaObserver;
import com.fancy.learncenter.utils.LogUtil;
import com.fancy.learncenter.utils.ToastUtil;
import com.fancy.teeya.R;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class SplashActivity extends BaseActivity {

    @Bind(R.id.backgroup)
    LinearLayout backgroup;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash, Status.NAVIGATION);
        ButterKnife.bind(this);
    }


    @OnClick(R.id.backgroup)
    public void onViewClicked() {
        Map<String, Object> dataMap = new HashMap<>();
        dataMap.put("bizCode", "RoastingClubBanner");
        dataMap.put("appNo","1001");
        dataMap.put("libraryNo"," ");
        dataMap.put("regionId"," ");
        dataMap.put("longitude"," ");
        dataMap.put("latitude", " ");
        HttpMehtod.getInstance().testNet(new IdeaObserver<BaseDataBean<Student>>(this,true) {


            @Override
            public void onSuccess(BaseDataBean<Student> studentBaseDataBean) {
                Student student=studentBaseDataBean.getData();

                ToastUtil.show("==我成功请求了==");
                LogUtil.MyLog("onSuccess","======"+student.getAdvert().size());
            }

            @Override
            public void onFail(String code) {
                ToastUtil.show("==我请求错误=="+code);
            }
        },dataMap);
    }
}
